<?php echo $this->form; ?>
<?php if($this->paginator):?>
	<div class="data-cell-thin">Order Id</div>
	<div class="data-cell-mid">Total</div>
	<div class="data-cell-mid">Adj Total</div>
	<div class="data-cell-mid">User Id</div>
	<div class="data-cell-mid">has Status</div>
	<div class="data-cell-mid">Status Date</div>
	<div class="clear"></div>
	<?php foreach($this->paginator as $record):?>
		<div class="data-cell-thin"><a href="<?php echo $this->url(array("module" => "order", "controller" => "view", "action" => "details", "orderId" => $record['id']), null, true );?>"><?php echo $record['id'];?></a></div>
		<div class="data-cell-mid"><?php echo Custom_FormatCurrency::formatAmount($record['total']/100);?></div>
		<div class="data-cell-mid"><?php echo Custom_FormatCurrency::formatAmount($record['adjustedTotal']/100); ?></div>
		<div class="data-cell-mid"><?php echo $record['userId']; ?></div>
		<div class="data-cell-mid"><?php echo $record['status']; ?></div>
		<div class="data-cell-mid">
			<?php 
			switch($record['status']){
				case 'created':
					echo $record['createdOn'];
					break;
				case 'shipped':
					echo $record['shippedOn'];
					break;
				case 'received':
					echo $record['receivedOn'];
					break;
				case 'under_review':
					echo $record['checkedOn'];
					break;
				case 'pending':
					echo $record['checkedOn'];
					break;
				case 'rejected':
					echo $record['completedOn'];
					break;
				case 'paid':
					echo $record['completedOn'];
					break;
				case 'closed':
					echo $record['closedOn'];
					break;
				}
			?>
		</div>
		<div class="clear"></div>
	<?php endforeach;?>
	<?php echo $this->paginationControl($this->paginator, 'Jumping', 'pagination.phtml'); ?>
<?php endif;?>
	